home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Aventura
/
FireMan.swf
/
scripts
/
frame_1114
/
PlaceObject2_530_76
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2008-09-12
|
3KB
|
121 lines
onClipEvent(enterFrame){
function doexplode()
{
this.gotoAndStop("death");
}
function drawframe()
{
this.gotoAndStop("standing");
}
xi -= heroe.scrollspeed;
_X = _X - heroe.scrollspeed;
yi -= heroe.vscrollspeed;
_Y = _Y - heroe.vscrollspeed;
_visible = false;
hitable = this.hitTest(_parent.mascara);
if(hitable)
{
_visible = true;
if(this.sprite.hotzone.hitTest(heroe.sprite.hotzone))
{
heroe.damage = 2;
heroe.hitted = true;
}
if(this.sprite.hotzone.hitTest(_root.shoot1) && hitable)
{
hitted = true;
_root.shoot1.impact = true;
_root.hitted.start();
}
if(timerdamage == 0 && hitted)
{
timerdamage = FLASHTIME;
currentdamage += DAMAGE;
}
if(timerdamage > 0)
{
flashing = true;
timerdamage--;
}
if(flashing && timerdamage == 0)
{
flashing = false;
hitted = false;
}
if(currentdamage >= MAXDAMAGE)
{
death = true;
delete shoot;
}
if(death && !du)
{
_root.shoot1.impact = false;
du = true;
doexplode();
}
}
if(!death)
{
if(descending)
{
heroe.DAMAGE = 2;
dy = 3;
_Y = _Y + dy;
if(_Y >= heroe._y - heroe._height / 2 - 64 && heroe.vertical == 0)
{
dy = 0;
descending = false;
attack = true;
shoot = new Sound();
shoot.attachSound("mflyershoot");
if(_X > heroe._x)
{
dx = SPEED;
forward = false;
}
else
{
dx = -1 * SPEED;
forward = true;
}
}
}
if(attack && !attacking)
{
attacking = true;
this.attachMovie("bullet","b1",1);
this.attachMovie("bullet","b2",2);
shoot.start();
b1.control.dx = 2;
b1.control.dy = 2;
b1._x = -8;
b1._y += 13;
b2.control.dx = -2;
b2.control.dy = 2;
b2._x = 8;
b2._y += 13;
wait = true;
c = 0;
}
if(wait)
{
c += 1;
if(c >= DELAY)
{
wait = false;
leave = true;
dy = 3;
}
}
if(leave)
{
_Y = _Y + dy;
if(_Y >= 240)
{
this.removeMovieClip();
}
}
drawframe();
}
}